package com.hhkj.study.admin.teacher.model.res;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.hhkj.study.admin.teacher.model.podo.TeacherPo;
import com.ruoyi.common.constant.Constants;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class TeacherRes extends TeacherPo {

    /**
     * 老师标签
     */
    private List<Map<String, Object>> tagMap;

    /**
     * 标签内容|隔开
     */
    private String tagContent;


    /**
     * 授课范围id列表
     */
    private List<Map<String, Object>> teacherScopeMap;

    /**
     * 授课范围|隔开
     */
    private String teachScopeContent;

    @JsonIgnore
    public List<Long> getTagList() {
        if (StrUtil.isBlank(getTags())) {
            return Lists.newArrayList();
        }
        return JSONUtil.toList(getTags(), Long.class);
    }
}